home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / textat11.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  1.2 KB  |  32 lines

  1. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TextAttribute
  4. //    Include File:    textattr.h
  5. //    Purpose:    Implement a way of giving a WWW style of attribute to
  6. //            a segment of a stream of data.
  7. //    Remarks/Portability/Dependencies/Restrictions:
  8. //        The difference between the start and end of an attribute is
  9. //        called extent.  Extent can be considered a correlation to
  10. //        calling strlen on a string.
  11. //        An extent of 0 means no duration, 1 means 1 byte, etc...
  12. //        A negative extent is equivalent to 0 extent.
  13. //        Once an attribute type is set by the constructor, it can
  14. //        never be changed.
  15. //    Revision History:
  16. //        02-01-94    created
  17. //        02-09-94    Split all members into seperate files.
  18. #include"textattr.h"
  19.  
  20. signed long int TextAttribute::getExtent() const    {
  21. //    Purpose:    Return the duration of an attribute.
  22. //    Arguments:    void
  23. //    Return Value:    signed long int    The duration of the attribute.
  24. //    Remarks/Portability/Dependencies/Restrictions:
  25. //        A negative durations is equivalent to no extent, or 0.
  26. //    Revision History:
  27. //        02-01-94    created
  28.  
  29.     return(sli_StreamOffset > sli_StreamExtent ? 0L : sli_StreamExtent -
  30.         sli_StreamOffset);
  31. }
  32.